package com.course.domain.enums;

/**
 * Created by Justin on 2017/5/19.
 */
public enum Week {
    MON(1, "Mon", "周一"),
    TUE(2, "Tue", "周二"),
    WED(3, "Wed", "周三"),
    THU(4, "Thu", "周四"),
    FRI(5, "Fri", "周五"),
    SAT(6, "Sat", "周六"),
    SUN(7, "Sun", "周日"),;

    private int value;
    private String name;
    private String title;

    Week(int value, String name, String title) {
        this.value = value;
        this.name = name;
        this.title = title;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public String getTitle() {
        return title;
    }

    public static Week of(int value) {
        for (Week week : values()) {
            if (week.value == value) {
                return week;
            }
        }
        throw new IllegalArgumentException();
    }
}
